//
//  ACEMeChangePSDCell.m
//  ACE
//
//  Created by zhangtao on 2018/8/13.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEMeChangePSDCell.h"

@implementation ACEMeChangePSDCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (IBAction)getCodeBtn:(id)sender {
}

-(void)setInputIsBtn:(BOOL)inputIsBtn{
    if (inputIsBtn == YES) {
        [self createInpuBtn];
    }
}

-(void)setInputBtnTitle:(NSString *)inputBtnTitle{
    [self createInpuBtn];
    [_inputBtn setTitle:inputBtnTitle forState:UIControlStateNormal];
    [_inputBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_inputBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, -20, 0, _inputBtn.frame.size.width-120)];
}

-(void)createInpuBtn{
    if (!_inputBtn) {
        _inputBtn = [[UIButton alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_titleLab.frame)+10, 0, self.frame.size.width-CGRectGetMaxX(_titleLab.frame)-10, self.frame.size.height)];
        [self addSubview:_inputBtn];
        _inputBtn.titleLabel.font = [UIFont systemFontOfSize:17];
        [_inputBtn setImage:[UIImage imageNamed:@"greenRightArrow"] forState:UIControlStateNormal];
        [_inputBtn setImageEdgeInsets:UIEdgeInsetsMake(0, _inputBtn.frame.size.width-20, 0,10)];
        [_inputBtn addTarget:self action:@selector(dateSelect) forControlEvents:UIControlEventTouchUpInside];
        _TF.hidden = YES;
    }
}

-(void)dateSelect{
    if (self.psdEndDateCallBack) {
        self.psdEndDateCallBack();
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
